package com.whcoding.international.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: International
 * @description:
 * @author: whcoding
 * @create: 2022-08-02 15:40
 **/
@RestController
public class HelloController {
	@Autowired
	MessageSource messageSource;

	@GetMapping("/hello")
	public String hello() {
		return messageSource.getMessage("login.username", null, LocaleContextHolder.getLocale());
	}
}

